﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using SyncLib.Data;
using Microsoft.Synchronization.Data;
using System.Data.SqlClient;

namespace SyncLib.Interface
{
    [ServiceContract]
    [ServiceKnownType(typeof(ScopeInfoEx))]
    [ServiceKnownType(typeof(TableOfScope))]
    [ServiceKnownType(typeof(DependencyTable))]
    [ServiceKnownType(typeof(ScopeInfoEx))]    
    [ServiceKnownType(typeof(WebSyncFaultException))]
    [ServiceKnownType(typeof(SqlException))]
   public interface ISyncConfigManager
    {
        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        Byte[] GetAssembly(Guid scopeExId);
        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        Byte[] GetFileOfSCope(Guid scopeExId, string fileKey);

        [OperationContract]
        Byte[] GetApplicationResource(string path, string type);
        
        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        ScopeInfoEx[] GetScopeInfo(Guid clientId);

        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        ScopeInfoEx GetScopeInfoByName(string scopeName,Guid clientId);
        
        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        void CreateScopeDescription(DbSyncScopeDescription scopeDescription,ScopeInfoEx scope);

        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        void CreateTemplateDescription(Microsoft.Synchronization.Data.DbSyncScopeDescription scopeDescription, ScopeInfoEx scope);

        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        DbSyncScopeDescription GetScopeDescription(ScopeInfoEx scope);
        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        DbSyncScopeDescription GetTemplateDescription(ScopeInfoEx scope);
        
        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        bool ExistsScope(ScopeInfoEx scope);

        [OperationContract]
        [FaultContract(typeof(WebSyncFaultException))]
        bool ExistsTemplate(ScopeInfoEx scope);

        [OperationContract]
        string CheckClientId(Guid clientId);

    }
}
